retire is_fatal for better static analysis (#797)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Thu, 16 Dec 2021 22:00:12 +0000 (15:00 -0700)
committerGitHub <noreply@github.com>
Thu, 16 Dec 2021 22:00:12 +0000 (15:00 -0700)
commit5901586428bc4301b69519ec29a2bafbcfbaf785
tree08c2487b3c7e18e195979b3b658da2322b1d04e7
parent9fb887da0bf858f09b01d0199fd1aeac5242537b
retire is_fatal for better static analysis (#797)

* join is_fatal lines in prep for transformation.

1,$g/is_fatal.*[^;]$/j

* replace is_fatal with if() fatal().

this allows better static analysis.

sed -i '1,$s/^\( *\)is_fatal *( *\(.*\), *MYNAME\([^;]*\);$/\1if (\2) {\n\1  fatal(MYNAME\3;\n\1}/' $file
sed -i '1,$s/^\( *\)is_fatal *( *\(.*\), *"\([^;]*\);$/\1if (\2) {\n\1  fatal("\3;\n\1}/' $file

* manual delete extra parenthesis.
18 files changed:
defs.h
exif.cc
f90g_track.cc
garmin_fit.cc
garmin_gpi.cc
garmin_txt.cc
gbfile.cc
gdb.cc
globalsat_sport.cc
magproto.cc
mapbar_track.cc
mmo.cc
raymarine.cc
subrip.cc
unicsv.cc
util.cc
vecs.cc
xcsv.cc